package com.rx.mgt.handler;  
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.handler.SimpleMappingExceptionResolver;

public class CommonExceptionHandler extends SimpleMappingExceptionResolver {

    private Logger logger = Logger.getLogger(CommonExceptionHandler.class);
    @Override
    protected ModelAndView doResolveException(HttpServletRequest request,
            HttpServletResponse response, Object handler, Exception ex) {
        
        logger.error(ex.getMessage(), ex);
        return super.doResolveException(request, response, handler, ex);
    }
    
}